
package ch.raph.test.mvc.view;

import ch.raph.test.mvc.controller.AbstractController;
import ch.raph.test.mvc.model.Observer;

public class View implements Observer<Double>
    {
    
    /*------------------------------------------------------------------
    attributs private
    ------------------------------------------------------------------*/
    private AbstractController<Double> m_controller;
    
    /*------------------------------------------------------------------
    constructors
    ------------------------------------------------------------------*/
    
    public View(AbstractController<Double> controller)
        {
        m_controller = controller;
        }
    
    /*------------------------------------------------------------------
    methods public
    ------------------------------------------------------------------*/
    @Override
    public void update(Double before, Double after)
        {
        System.out.println("before = " + before + " | after = " + after);
        }
    
    public void c()
        {
        m_controller.reset();
        }
    
    public void click(double d)
        {
        m_controller.setData(d);
        }
    }
